<template>
  <div>
      <p>
          <span>{{name}}</span>
          <button @click="add(index)">+</button>
          <span>{{count}}</span>
          <button @click="sub(index)">-</button>
      </p>
  </div>
</template>

<script>
export default {
    props:["name",'count','index'],
    methods:{
        add(index){
            this.$emit('addCount',index)
        },
        sub(index){
            this.$emit('subCount',index)
        }
    }
}
</script>

<style>

</style>